<template>
    <div class="scene-content">
        <div class="w1200">
            <div class="title">让驾校经营更便捷、更安全、更省心</div>
            <div class="scene-tabs">
                <div v-for="(tab, idx) in tabs" :key="tab.key" :class="['scene-tab', { active: idx === activeTab }]"
                    @click="activeTab = idx">
                    {{ tab.label }}
                </div>
            </div>
            <div class="scene-divider"></div>
            <div class="scene-panel">
                <div class="scene-img">
                    <img :src="tabs[activeTab].img" alt="" />
                </div>
                <div class="scene-info">
                    <div class="scene-title">{{ tabs[activeTab].title }}</div>
                    <div class="scene-desc" v-html="tabs[activeTab].desc"></div>
                    <div class="scene-tags" v-if="tabs[activeTab].tags && tabs[activeTab].tags.length">
                        <span class="scene-tag" v-for="tag in tabs[activeTab].tags" :key="tag">{{ tag }}</span>
                    </div>
                    <button class="scene-btn" @click="showConsult = true">了解详情</button>
                </div>
            </div>
        </div>
        <consult v-if="showConsult" @close="showConsult = false" />
    </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import consult from '@/components/consult.vue';

const showConsult = ref(false);
const tabs = [
    {
        key: 'office',
        label: '多种经营模式',
        img: 'https://image.lutongjiakao.com/system/d02def25366a4e628558b6d75fca62cd.jpg',
        title: '通用解决方案',
        desc: `为集团型、联盟型、大型驾校、中小型驾校、挂靠经营模式提供解决方案；
    适应不同规模与模式的驾校运营需求，助力管理效率提升！`,
        tags: ['集团型', '大型驾校', '中小型驾校']
    },
    {
        key: 'training',
        label: '客户培训',
        img: 'https://image.lutongjiakao.com/system/ccbfa91c52a64969ac6594b8586407e7.jpg',
        title: '多对一企业微信群服务',
        desc: `时刻关注您的系统使用进展，1对1进行系统关键流程的操作教学，部分复杂参数配置可以由我们代您完成操作！全程跟踪，快速推动项目上线`,
        tags: ['多对一服务', '毫秒级响应']
    },
    {
        key: 'design',
        label: '售后服务',
        img: 'https://image.lutongjiakao.com/system/8a3861ce328c4e80a219f73e287e42ec.jpg',
        title: '极致安心的售后服务',
        desc: `这里有售前/售后/运维/产品经理...7*24小时高效响应，有针对性解决，无论有任何系统问题，欢迎来撩！`,
        tags: ['售后保障', '7*24小时']
    },
    {
        key: 'software',
        label: '系统迭代',
        img: 'https://images.unsplash.com/photo-1461749280684-dccba630e2f6?auto=format&fit=crop&w=600&q=80',
        title: '业界领先的研发效率',
        desc: `围绕场景需求，定期更新维护，用与时俱进的理念持续打磨产品，始终以研发一套易用好用的产品为研发理念，用严苛的技术标准打造软件品牌价值，为客户提供安全、稳定、流畅的使用体验`,
        tags: ['精益求精', '稳定安全']
    }
]

const activeTab = ref(0)
</script>

<style lang="scss" scoped>
@use 'sass:math';

@function rem($px) {
    @return math.div($px, 16) * 1rem;
}

.scene-content {
    background: rgb(242, 251, 247);
    padding: rem(60) 0;
}

.w1200 {
    width: rem(900);
    margin: 0 auto;
}

.title {
    text-align: center;
    color: #000;
    font-size: rem(36);
    font-weight: 700;
    margin-bottom: rem(40);
}

.scene-tabs {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    position: relative;
}

.scene-tab {
    font-size: rem(16);
    color: #666;
    padding: rem(0) rem(4);
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    transition: color 0.2s;

    &.active {
        color: rgb(37, 207, 107);
        font-weight: 500;
        border-bottom: 3px solid rgb(37, 207, 107);
    }
}

.scene-divider {
    width: 100%;
    height: 1px;
    background: #eaeaea;
    margin-bottom: rem(30);
}

.scene-panel {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: rem(40);
    margin-top: rem(10);
}

.scene-img {
    width: rem(487.5);
    height: rem(300);
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

.scene-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.scene-title {
    font-size: rem(22);
    font-weight: 700;
    color: #222;
    margin-bottom: rem(16);
}

.scene-desc {
    font-size: rem(12);
    color: #444;
    line-height: 1.8;
    margin-bottom: rem(18);
    word-break: break-all;
}

.scene-tags {
    margin-bottom: rem(18);
}

.scene-tag {
    display: inline-block;
    background: #e6f7f3;
    color: #1abc9c;
    font-size: rem(14);
    border-radius: rem(12);
    padding: rem(4) rem(14);
    margin-right: rem(10);
    margin-bottom: rem(6);
}

.scene-btn {
    width: rem(110);
    height: rem(36);
    background: linear-gradient(90deg, rgb(15, 210, 183) 0%, rgb(37, 207, 107) 99%);
    color: #fff;
    border: none;
    border-radius: rem(18);
    font-size: rem(16);
    cursor: pointer;
    transition: background 0.2s;
    margin-top: rem(10);

    &:hover {
        background: #159c80;
    }
}
</style>